/***********************************************************************
 * Module:  VehicleTypeController.java
 * Author:  Administrator
 * Purpose: Defines the Class VehicleTypeController
 ***********************************************************************/

package ishitong.vehicleManagement.controller;

import ishitong.common.model.SysCode;
import ishitong.dataDictionary.controller.SysCodeType;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/** @pdOid c62866bb-ce05-4a09-97f9-16824fa177f9 */
@Controller
public class VehicleTypeController extends ishitong.common.controller.ActionController {
   /** @pdOid 1b53988d-c94c-4ba6-afbf-19aea37cee53 */
   private static final String VCT_SLT_DLG = "vehicleManagement/vehicleType/vehicleTypeSelectDialog";
   /** @pdOid af95e9b8-1601-4564-af9c-75d7f64785e4 */
   private static final String VCT_SLT_LST = "vehicleManagement/vehicleType/vehicleTypeSelectList";
   
   /** @param request
    * @pdOid 43185371-fa3d-4860-af37-03e1a55ad6b5 */
   @RequestMapping(value = "/ajaxShowVehicleTypeSelectDialog.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxShowVehicleTypeSelectDialog(HttpServletRequest request) {
   	return new ModelAndView(VCT_SLT_DLG);
   }
   
   /** @param request 
    * @param sysCode
    * @pdOid 604c800f-ae65-4d65-ba4c-ede4238f3afe */
   @RequestMapping(value = "/ajaxFindVehicleTypeSelectList.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxFindVehicleTypeSelectList(HttpServletRequest request, SysCode sysCode) {
   	try {
   		Map<String, Object> model = new HashMap<>();
   		List<SysCode> listVehicleType = spiSysCodeService.getSysCodeListByTypeCodeAndCondition(SysCodeType.VEHICLE_TYPE,sysCode);
   		model.put("listVehicleType", listVehicleType);
   		return new ModelAndView(VCT_SLT_LST, model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }

}